Skip to content

Studio map: the system-map tests check a plain folder, not a git repo per case (#818) - #819

Merged
danielrispler merged 2 commits into
mainfrom
issue-818-studio-map-the-system
Nov 28, 2026
Merged

danielrispler merged 2 commits into
mainfrom
issue-818-studio-map-the-system

Conversation

@danielrispler

Copy link
Copy Markdown
Owner

Closes #818 (part of #803, fix direction 1, for studio-system-map only).

Summary

Most studio-system-map cases now write a plain temporary folder with no git. common.rs keeps each folder's tracked files and hands them to system_map::check_files. A file that is written but left out of that list is untracked, as before. A folder becomes a real repo only where git or the binary reads it.

 project / project_text / repo
-  git init + empty commit, write, add, commit (+ add, commit)
+  write into a plain folder, track(the files written)
 problems / report / sites(no args) / assert_* helpers
-  system_map::check            -> git ls-files
+  system_map::check_files(tracked)
 run / imports_json / binary.rs / imports.rs
+  git_repo: init + add of the tracked files (index only, no commit)
   system-map binary
 --commit cases (every language, edges, c)
+  commit(&root)               -> one real commit
 test's own `git add -A` + `commit`
-  git add -A, git commit
+  track_all (git add -A as well when the folder is already a repo)

These still use a real repo:

  • CLI tests: binary.rs and imports.rs drive the binary on a real repo.
  • Scan: scan.rs runs init and add.
  • Commit mode: every --commit case commits once.
  • check() itself: ownership::an_untracked_file_is_never_counted runs system_map::check on a real repo and shows that an untracked file is left out.

touched.rs keeps no repo. The ticket expected it to read history, but touched() places paths by pattern and makes no git call (system-map/src/touched.rs:23-25).

These assertions changed form; what they claim is unchanged:

  • assert_unsure_file_listed_and_link_unproven: it used to look for the binary's pass line, 1 import (0 proven, 1 unproven). It now checks report.problems is empty and that counts.links is (import, proven, unproven) == (1, 0, 1).
  • assert_only_candidate_links_relaxed: it now compares against the report's problems and notes. A test-only printed() rebuilds the binary's note lines from print_check (system-map/src/cli.rs:89-97), so a change to that wording would not fail this helper.
  • sites() with no arguments: it serializes the Report, which is what check --json prints. With --commit it still runs the binary.
  • imports_json: it stays on the binary, since system_map::imports has no variant that takes a file list.

No test was removed or merged.

Evidence

Measured back to back on the same machine, at origin/main (68cb0c709, 511 tests including #814's c.rs) against this branch:

Before After
cargo nextest list -p studio-system-map --test it 511 511, all pass
git calls (ticket's shim) 9,243 742
/usr/bin/time -p real 41.20 s 5.56 s
user + sys 55.78 + 74.03 = 129.8 s 6.52 + 8.08 = 14.6 s

On the ticket's base 92c2640a8 (496 tests), the counts were 8,242 git calls before and 667 after.

npm run check passes.

Merge Danger

Door: two-way. The change is test setup only, with no source, stored type or map change.

Blast Radius: tests

If check() and check_files() ever start to differ beyond where the file list comes from, most tests would no longer see it. ownership::an_untracked_file_is_never_counted, the binary tests and the --commit tests still cover check() on a real repo.

Correctness pass

There were three review passes, and the fixes from the first two are in the second commit:

  • Standards and spec review (/code-review):
    • touched.rs:182 ran system_map::check on a plain folder, and passed only because its subset assertion is loose. It now uses common::report.
    • report kept a fallback to check() that no test reached. It is gone.
    • In laws.rs, the helper named commit no longer committed. It is now write_tracked.
    • In edges.rs, run_check only passed its arguments on. It is inlined.
    • The new key helper had no doc comment.
    • Two points are left as they are and noted above: the assertion forms that changed, and the copy of the note wording in printed().
  • Correctness pass: a reviewer traced the tracked set, old against new, for every helper and edge case: symlinks, deleted files, HEAD~1, and paths that canonicalize to /private/var. It also ran the suite. It found no problems.
  • After the rebase onto origin/main: Studio map: the C/C++ extractor, c-includes (#806) #814's new c::commit_mode_gives_the_pairs_of_the_working_tree failed, because it reads a commit. It now calls commit(&root).

Outside review

skipped: no risk match

🤖 Generated with Claude Code

danielrispler and others added 2 commits November 28, 2026 18:29
… per case (#818)

Most cases write a plain folder and hand its tracked files to check_files; a
folder becomes a real repository, index only, where git or the binary reads it,
and commits only where a case reads one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
touched.rs's check runs on the folder's tracked list, report has no git
fallback nothing used, laws' helper is write_tracked, edges calls run directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danielrispler
danielrispler merged commit 8a3b2c1 into main Nov 28, 2026
2 checks passed
@danielrispler
danielrispler deleted the issue-818-studio-map-the-system branch November 28, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio map: the system-map tests check a plain folder, not a git repo per case (#803)

1 participant